package JavaSE.CODE.javaCollection.Generic;

public class Test {
    public static void main(String[] args) {
        //泛型类

        GenericClassDemo genericClassDemo = new GenericClassDemo();
        genericClassDemo.prinT();

        //使用泛型类创建对象
        GenericClassDemo<String> genericClassDemo1 = new GenericClassDemo<>();
        genericClassDemo1.t = "我将作为genericDemo1的成员啦！";
        genericClassDemo.show("大家好，你直接传递给我T类型的参数我就能用");
        System.out.println(genericClassDemo1.t);

        /////////
        //泛型接口
        GenericImpl generic = new GenericImpl();
        generic.server("类实现接口的时候就传入泛型哦！");

        GenericImpl2<String> genericImpl2 = new GenericImpl2<>();
        genericImpl2.server("我是通过泛型类的方法实现的");

        GenericImpl2 genericImpl21 = new GenericImpl2();
        genericImpl21.printT();

        /////////
        GenericMethod genericMethod = new GenericMethod();
        System.out.println(genericMethod.showw("String"));
        genericMethod.show("String");
        genericMethod.show(123);
        genericMethod.show(3.131);



    }
}
